<%@ include file="/WEB-INF/views/jsp/include/include.jsp"%>
<html>
<head>
<title>Hand In Hand</title>
<%@ include file="/WEB-INF/views/jsp/include/head.jsp"%>
</head>

<body>
	<%@ include file="/WEB-INF/views/jsp/include/header.jsp"%>
	<%@ include file="/WEB-INF/views/jsp/include/navigator.jsp"%>

	<div class="container-fluid">


		<form:form id="ResultViewForm" modelAttribute="resultViewForm">
			<c:choose>
			
			
				<c:when test="${resultViewForm.isEmptyResult == 1}">
				</c:when>
			
				<c:when test="${resultViewForm.isEmptyResult == 0}">

					<c:choose>
						<c:when test="${resultViewForm.selection=='community'}">
							<c:forEach var="community" items="${resultViewForm.searchList}">
								<div
									style="width: 400px; height: 130px; overflow: hidden; border: 1px solid #898787 !important; border-radius: 10px; margin-top: 4px; margin-bottom: 4px; margin-left: 4px; margin-right: 4px; padding-bottom: 3px; padding-top: 3px;"
									class="col-xs-4">
									<div class="col-xs-3" style="padding-left: 0;">
										<img
											style="padding-top: 10px; padding-bottom: 5px; width: 70px;"
											src=<c:url value="resources/images/community-icon.png"/>
											class="img-rounded">
									</div>
									<div class="col-xs-9"
										style="padding-top: 8px; padding-left: 0;">
										<a class="list-group-item-warning"
											href="<spring:url value='/communities/${community.id}'></spring:url>">
											<strong style="font-size: 1.2em; overflow-wrap: break-word;">${community.name}</strong>
										</a> <span style="font-size: 0.7em; color: gray;">${fn:length(community.members) }
											members</span><br> <span
											style="font-size: 0.9em; font-style: oblique; height: 30px; overflow-wrap: break-word;">${community.privacy}</span>
										<br> <span
											style="font-size: 0.9em; font-style: oblique; height: 30px; overflow-wrap: break-word;">${community.description}</span>

									</div>
								</div>
							</c:forEach>
						</c:when>
						<c:when test="${resultViewForm.selection=='offer'}">
							<c:forEach var="offer" items="${resultViewForm.searchList}">
								<div
									style="width: 450px; height: 200px; border: 1px solid #898787 !important; border-radius: 10px; margin-top: 4px; margin-bottom: 4px; margin-left: 4px; margin-right: 4px; padding-bottom: 3px; padding-top: 3px;"
									class="col-xs-4">

									<a class="list-group-item-warning"
										href="<spring:url value='/communities/${offer.community.id}/offers/${offer.id}'></spring:url>">
										${offer.name} </a><br> ${offer.description} <br> <b>Ends:
									</b> ${offer.expirationDate} <br> <b>Community Belonged: </b>
									<a class="list-group-item-warning"
										href="<spring:url value='/communities/${offer.community.id}'></spring:url>">
										${offer.community.name} </a><br>
								</div>
							</c:forEach>
						</c:when>
						<c:when test="${resultViewForm.selection=='request'}">
							<c:forEach var="request" items="${resultViewForm.searchList}">
								<div
									style="width: 450px; height: 200px; border: 1px solid #898787 !important; border-radius: 10px; margin-top: 4px; margin-bottom: 4px; margin-left: 4px; margin-right: 4px; padding-bottom: 3px; padding-top: 3px;"
									class="col-xs-4">

									<a class="list-group-item-warning"
										href="<spring:url value='/communities/${request.community.id}/requests/${request.id}'></spring:url>">
										${request.name} </a><br> ${request.description} <br> <b>Ends:
									</b> ${request.expirationDate} <br> <b>Community Belonged:
									</b> <a class="list-group-item-warning"
										href="<spring:url value='/communities/${request.community.id}'></spring:url>">
										${request.community.name} </a><br>
								</div>
							</c:forEach>

						</c:when>

						<c:when test="${resultViewForm.selection=='events'}">
							<c:forEach var="event" items="${resultViewForm.searchList}">
								<div
									style="width: 450px; height: 200px; border: 1px solid #898787 !important; border-radius: 10px; margin-top: 4px; margin-bottom: 4px; margin-left: 4px; margin-right: 4px; padding-bottom: 3px; padding-top: 3px;"
									class="col-xs-4">

									<a class="list-group-item-warning"
										href="<spring:url value='/communities/${event.community.id}/events/${event.id}'></spring:url>">
										${event.name} </a><br> ${event.description} <br> <b>Starts:
									</b> ${event.startingTime} <br> <b>Ends: </b>
									${event.endingTime} <br> <b>Place: </b> ${event.location}
									<br> <b>Community Belonged: </b> <a
										class="list-group-item-warning"
										href="<spring:url value='/communities/${event.community.id}'></spring:url>">
										${event.community.name} </a><br>
								</div>
							</c:forEach>

						</c:when>
						<c:when test="${resultViewForm.selection=='user'}">
							<c:forEach var="friendship" items="${resultViewForm.searchList}">
								<div
									style="width: 400px; height: 90px; border: 1px solid #898787 !important; border-radius: 10px; margin-top: 4px; margin-bottom: 4px; margin-left: 4px; margin-right: 4px; padding-bottom: 3px; padding-top: 3px;"
									class="col-xs-4">
									<div class="col-xs-3" style="padding-left: 0;">
										<img
											style="padding-top: 10px; padding-bottom: 5px; width: 70px;"
											src=<c:url value="resources/images/maleicon.jpg"/>
											class="img-rounded">
									</div>
									<a class="list-group-item-warning"
										href="<spring:url value='/user/${friendship.id}'></spring:url>">
										${friendship.username} </a><br> ${friendship.name}
									${friendship.surname}<br> <br> ${friendship.status}
									Account
								</div>
							</c:forEach>
						</c:when>

					</c:choose>
				</c:when>



			</c:choose>



		</form:form>
	</div>

	<%@ include file="/WEB-INF/views/jsp/include/footer.jsp"%>

</body>
</html>